package com.example.controller.redis;

import com.example.annoation.redis.CustomCache;
import com.example.pojo.entity.redis.Test;
import com.example.service.redis.TestService;
import com.example.pojo.vo.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/9/26 14:27
 */
@RestController
@RequestMapping("test3")
@Slf4j(topic = "CACHE-TestController3")
public class TestController3 {

    @Autowired
    TestService testService;

    @RequestMapping(value = "save")
    public Result save(Test test){
        testService.save(test);
        return Result.OK(null);
    }
    @RequestMapping(value = "update")
    public Result update(Test test){
        testService.update(test);
        return Result.OK(null);
    }

    @RequestMapping(value = "customCache")
    @CustomCache
    public Result CustomCache(Test test){

        return Result.OK(null);
    }








}
